home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-06-03 | 1.7 KB | 89 lines | [TEXT/MPS ] |
- ;------------------------------------------------------------------------------
- ;
- ; FILENAME
- ; BP_EP.a
- ;
- ; COPYRIGHT
- ; Copyright © Marshall Clow 1992
- ; All rights reserved.
- ;
- ; This file contains routines to replace the “trace” routines
- ; in the library. Calls to these routines are generated by the compiler
- ; at the begining and end of each procedure.
- ;
- ;--------------------------------------------------------------------------------
-
- INCLUDE 'Traps.a'
-
- STRING ASIS
- CASE OBJ
-
- IMPORT FindMacsBugName
- IMPORT BreakHere
-
-
- ;; called at the beginning of every routine
- %_BP PROC EXPORT
- MoveM.L D0/D1/D2/A0/A1, -(A7) ; save the registers
- jsr BreakHere
- Beq.s @1
-
- Move.L $14(A7), D0 ; 5 saved registers * 4 bytes per
- Pea ProcName
- Move.L D0, -(A7) ; return address
- jsr FindMacsBugName
- addq #$8, A7 ; pop parameters
- Tst.L D0
- beq.s @1
-
- Lea ProcName, A0
- Move.B (A0), D0
- Move.B #$20, (A0)
- Lea TheStr, A0
- Add.B #$7, D0
- Move.B D0, (A0)
- Move.L A0, -(A7)
- _DebugStr
- MoveM.L (A7)+, D0/D1/D2/A0/A1 ; put the registers back
- @1 RTS
-
- TheStr DC.B $07
- DC.B 'Enter:'
- ProcName DC.B 0
- DC.L 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
- JunkPtr DC.L 0
- ENDP
-
- ;; called at the end of every routine
- ;; do I need to save the registers ?
- %_EP PROC EXPORT
- MoveM.L D0/D1/D2/A0/A1, -(A7)
- jsr BreakHere
- Beq.s @1
-
- Move.L $14(A7), D0 ; 5 saved registers * 4 bytes per
- Pea ProcName
- Move.L D0, -(A7) ; return address
- jsr FindMacsBugName
- addq #$8, A7 ; pop parameters
- Tst.L D0
- beq.s @1
-
- Lea ProcName, A0
- Move.B (A0), D0
- Move.B #$20, (A0)
- Lea TheStr, A0
- Add.B #$6, D0
- Move.B D0, (A0)
- Move.L A0, -(A7)
- _DebugStr
- MoveM.L (A7)+, D0/D1/D2/A0/A1
- @1 RTS
-
- TheStr DC.B $06
- DC.B 'Exit:'
- ProcName DC.L 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
- JunkPtr DC.L 0
- ENDP
-
- END